package com.lkc.mapper;

import com.lkc.bean.Orders;
import com.lkc.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface OrdersDao {
    int add(@Param("param") Orders orders);
    int del(@Param("id") Integer orderId);
    int edit(@Param("param") Orders orders);
    Orders one(@Param("id") Integer orderId);
    int pageCount(@Param("param") Orders orders);
    List<Orders> all(@Param("param") Orders orders);
    List<Orders> page(@Param("page") Page page, @Param("param") Orders orders);

    // 新增：按买家ID查询
    List<Orders> findByBuyerId(@Param("buyerId") Integer buyerId);
    // 根据日期查询订单数量
    int getCountByDate(@Param("date") LocalDate date);

}
